#ifndef __DAHUA_MULTICAMERAS_MVIMAGEBUF_H__
#define __DAHUA_MULTICAMERAS_MVIMAGEBUF_H__

#pragma warning(disable:4786)

#include "Infra/IntTypes.h"
#include "Memory/SharedPtr.h"

namespace Dahua{

class CMvImageBuf
{
public:
	CMvImageBuf(uint32_t iImageSize)
		: m_pDataBuf(NULL)
		, m_iDataSize(iImageSize)
	{
		if ( iImageSize > 0 )
		{
			m_pDataBuf = new uint8_t[iImageSize];
		}
	}

	~CMvImageBuf()
	{
		if ( NULL != m_pDataBuf )
		{
			delete[] m_pDataBuf; 
		}
	}

public:
	uint8_t* bufPtr()
	{
		return m_pDataBuf;
	}

	uint32_t	bufSize()
	{
		return m_iDataSize;
	}

	uint32_t imageWidth()
	{
		return m_iWidth;
	}

	uint32_t imageHeight()
	{
		return m_iHeight;
	}

	uint32_t imagePixelFormat()
	{
		return m_pixelFormat;
	}

	void setImageWidth(uint32_t iWidth)
	{
		m_iWidth = iWidth;
	}

	void setImageHeight(uint32_t iHeight)
	{
		m_iHeight = iHeight;
	}

	void setImagePixelFormat(uint32_t pixelFormat)
	{
		m_pixelFormat = pixelFormat;
	}


private:
	uint8_t*						m_pDataBuf;
	uint32_t						m_iDataSize;
	uint32_t						m_iWidth;
	uint32_t						m_iHeight;
	uint32_t						m_pixelFormat;
};

typedef Memory::TSharedPtr<CMvImageBuf> CMvImageBufPtr;

} // namespace Dahua

#endif // __DAHUA_MULTICAMERAS_MVIMAGEBUF_H__
